
import Vue from 'vue'

Vue.directive('rainbow',{
  bind(el,binding,vnode){
    // el.style.background = "#" + Math.random().toString(16).slice(2,8);
    let color = +parseInt(Math.random()*255)+', '+parseInt(Math.random()*255)+', '+parseInt(Math.random()*255);
    el.style.background = 'rgb('+color+', .1)';
    el.style.color = 'rgb('+color+', 1)';
  }
})
Vue.directive('rainbowa',{ 
  bind(el,binding,vnode){
    el.style.color = "#" + Math.random().toString(16).slice(2,8);
  }
})

Vue.filter("snippet",function(value){
  return deleteHtmlTag(value).slice(0,120)+"...";
})
